package com.example.demo02.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo02.dao.BookDao;
import com.example.demo02.entity.Book;
import com.example.demo02.mapper.BookMapper;
import com.example.demo02.service.BookService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements BookService {
    @Resource
    private BookDao bookDao;

    public String getValue(String key){
        return bookDao.getValue(key);
    }

    public void setValue(String key,String value){
        bookDao.setValue(key,value);
    }

    @Override
    public void saveBooks(String s, List<Book> books) {
        bookDao.saveBooks(s,books);
    }

    public List<Book> findBooks(String id){
        return bookDao.findBooks(id);
    }

    public void saveBooks(Object key,List<Book> books) {
        bookDao.saveBooks(key,books);
    }

    public Book findBookById(int id) {

        return bookDao.findBookById(id);
    }

    public void saveBook(Book book) {
        bookDao.saveBook(book);
    }


    public void deleteBook(int id) {
        bookDao.deleteBook(id);
    }
}
